<?php include "./configs/session_check.php";
include "./configs/config.php";
sleep(1);

	$TaskID=$_POST['TaskID'];
    $NoteTitle=$_POST['NoteTitle'];
    $NoteDetails=$_POST['NoteDetails'];
    $AddedBy=$_SESSION['userid'];
	$DateAdded=date("Y-m-d");
	$TimeAdded=date("G:i:s");
	
     $query=("INSERT INTO Notes(TaskID,NoteTitle,NoteDetails,AddedBy,DateAdded,TimeAdded) 			 VALUES('$TaskID','$NoteTitle','$NoteDetails','$AddedBy','$DateAdded','$TimeAdded')");
    $exc_query=mysql_query($query);
   
    if($exc_query ){
        $note_id=mysql_query("SELECT * FROM Notes ORDER BY NoteID DESC LIMIT 1");
		$note_id_data=mysql_fetch_array($note_id);
        $return['msg'] = 'Note ID'.$note_id_data['NoteID'].' Added';
    }
    else
    {
        $return['msg'] = 'Failed';
    }

echo json_encode($return);